<?php
	include_once 'head.php';
	// $infoc=new info();
	$userc=new user();
	$user_id=$_GET['id'];

	//读取个人信息
	if($user_id!='' && $user_id!=null){
		$user=$userc->userInfo($user_id);
		$smarty->assign('user',$user);
	}	


	//判断是否为自己查看
	$cookie_id=$_COOKIE['user_id'];
	if($cookie_id==$user['id']){
		$smarty->assign('user_type',1);
	}


	//读取关注信息
	$where=" AND f.fans_id='".$user_id."'";
	$row=$userc->user_attention($user_id,$where);

	$smarty->assign('page',$row['page']);
	$smarty->assign('row',$row['result']);

	//关注
	$where=' AND c.fans_id="'.$user_id.'"';
	$gz=$userc->user_fans_num($where);
	$smarty->assign('gz',$gz);

	//被关注
	$where=' AND c.user_id="'.$user_id.'"';
	$bgz=$userc->user_fans_num($where);
	$smarty->assign('bgz',$bgz);

	$smarty->display("user_attention.html");
?>